﻿/*start format*/

function formatNumber(value, isNumber) {
    value = value + "";
    var result = '';
    var length = value.length;
    for (var i = 0; i < value.length; i++)
        if (value[i] == '.') {
            length = i + 1;
            break;;
        }

    for (i = 0; i < value.length; i++) {
        if (i != 0 && i != length - 1 && i < length && (length - i) % 3 == 0)
            result += ',';
        result += value[i];
    }
    if (isNumber)
        return result;
    return result + ' VND';
}
/*end format*/